package com.cm.caseManagement.service.impl;

import com.cm.caseManagement.utils.DateUtils;

import com.cm.caseManagement.dao.CmCaseAssignMapper;
import com.cm.caseManagement.pojo.entity.CmCaseAssign;
import com.cm.caseManagement.service.ICmCaseAssignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 案件分配Service业务层处理
 *
 * @author ruoyi
 * @date 2025-10-05
 */
@Service
public class CmCaseAssignServiceImpl implements ICmCaseAssignService
{
    @Autowired
    private CmCaseAssignMapper cmCaseAssignMapper;

    /**
     * 查询案件分配
     *
     * @param id 案件分配主键
     * @return 案件分配
     */
    @Override
    public CmCaseAssign selectCmCaseAssignById(Long id)
    {
        return cmCaseAssignMapper.selectCmCaseAssignById(id);
    }

    /**
     * 查询案件分配列表
     *
     * @param cmCaseAssign 案件分配
     * @return 案件分配
     */
    @Override
    public List<CmCaseAssign> selectCmCaseAssignList(CmCaseAssign cmCaseAssign)
    {
        return cmCaseAssignMapper.selectCmCaseAssignList(cmCaseAssign);
    }

    /**
     * 新增案件分配
     *
     * @param cmCaseAssign 案件分配
     * @return 结果
     */
    @Override
    public int insertCmCaseAssign(CmCaseAssign cmCaseAssign)
    {
        cmCaseAssign.setCreateTime(DateUtils.getNowDate());
        return cmCaseAssignMapper.insertCmCaseAssign(cmCaseAssign);
    }

    /**
     * 修改案件分配
     *
     * @param cmCaseAssign 案件分配
     * @return 结果
     */
    @Override
    public int updateCmCaseAssign(CmCaseAssign cmCaseAssign)
    {
        cmCaseAssign.setUpdateTime(DateUtils.getNowDate());
        return cmCaseAssignMapper.updateCmCaseAssign(cmCaseAssign);
    }

    /**
     * 批量删除案件分配
     *
     * @param ids 需要删除的案件分配主键
     * @return 结果
     */
    @Override
    public int deleteCmCaseAssignByIds(Long[] ids)
    {
        return cmCaseAssignMapper.deleteCmCaseAssignByIds(ids);
    }

    /**
     * 删除案件分配信息
     *
     * @param id 案件分配主键
     * @return 结果
     */
    @Override
    public int deleteCmCaseAssignById(Long id)
    {
        return cmCaseAssignMapper.deleteCmCaseAssignById(id);
    }
}
